import React, { useEffect, useState } from 'react';
import cls from 'classnames';
import style from './index.less';

const ShopList = ({ list = [], type = 'one' }) => {
    return (
        <div className={style['goods_wrap']}>
            {
                list.map((mr: any) => {
                    return (
                        <div className={style['goods_wrap_list']}>
                            <div className={style['market_name']}>{mr.name}</div>
                            <ul className={style[`${type}_mrket_wrap`]}>
                                {
                                    mr.Goods.map((it: any) => {
                                        return (
                                            <li className={style['goods_item']}>
                                                <img className={style['goods_pic']} src={it.main_pic} />
                                                <div className={style['goods_right']}>
                                                    <div className={style['goods_name']}>{it.name}</div>
                                                    {
                                                        mr.type === 'ONE' && <div className={style['goods_brief']}>{it.brief}</div>
                                                    }
                                                    <div className={style['goods_price']}>¥{it.price / 100}</div>
                                                </div>
                                            </li>
                                        )
                                    })
                                }
                            </ul>       
                        </div>
                    )
                })
            }
        </div>
    )
}

export default ShopList;